import App from './App'
import Vue from 'vue'
Vue.config.productionTip = false


import 'util/Storage.js'

import store from './store/index.js'

import uView from 'uview-ui'
Vue.use(uView)

import myRequest from 'util/Request.js'
Vue.prototype.kRequest = myRequest

Vue.filter('lenghtFil',(e,len)=>{
	try{
    return (e.length < len)?e:e.slice(0,len)+'...'
  }catch{
    return 'NULL'
  }
})

App.mpType = 'app'
const app = new Vue({
	store,
    ...App
})
app.$mount()

Vue.prototype.dateToString = (date,tag) =>{
	let y = date.getFullYear()
	let m = date.getMonth()+1
	let d = date.getDate()
	m = (m<10? '0':'') + m
	d = (d<10? '0':'') + d
	return y + tag + m + tag + d
}

Vue.prototype.mailReg = mail => {
	// console.log(mail)
	return mail!=''?
	/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(mail)
	: true
}

Vue.prototype.consoleLog = e =>{
	if(e)
		console.log(e)
	else
		console.log("触发")
}